package com.xbongbong.saas.enums;

import lombok.Getter;

@Getter
public enum OutLinkAdvancedEnum {
    TOTAL(0,"总计"),

    DAY(1,"每天"),

    MONTH(2,"每月"),

    YEAR(3,"每年"),
    ;

    /**
     * 设置类型标识
     */
    private Integer code;
    /**
     * 设置类型名字
     */
    private String name;


    OutLinkAdvancedEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static OutLinkAdvancedEnum getByCode(Integer code) {
        for (OutLinkAdvancedEnum cacheCode : values()) {
            if (cacheCode.getCode().equals(code)) {
                return cacheCode;
            }
        }
        return null;
    }
}
